<script>
	import Vue from 'vue'

	export default {
		onLaunch: function() {
			console.log('App Launch')
			this.musicInit()
			// uni.setTabBarItem({
			// 	index: 1,
			// 	visible: false
			// })
			// uni.hideTabBar()

			/* 重置首页公告弹窗状态 */
			uni.setStorageSync('_is_this_show', false)

			/* 清除缓存中的广告id */
			uni.removeStorageSync('_ad_id')
			/* 清除缓存中的click_id */
			uni.removeStorageSync('_click_id')
		},
		onShow: function() {
			console.log('App Show')
			// uni.hideTabBar()
		},
		onHide: function() {
			console.log('App Hide')
			// uni.hideTabBar()
		},

		methods: {
			musicInit() {
				this.req({
					url: 'get_yinxiao',
					data: {},
					success: res => {
						if (res.status == 1) {
							// const openBgm = uni.createInnerAudioContext()
							// openBgm.src = this.$img('/static/mp3/open.mp3')

							const bgmMusic = uni.createInnerAudioContext()
							bgmMusic.src = res.data
							bgmMusic.loop = true

							Vue.prototype.bgmCtx = {
								// openBgm,
								bgmMusic
							}
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import './common/animate.css';
	@import './style/style.scss';
	@import url('/components/gaoyia-parse/parse.css');

	/* 引入字体 */
	@font-face {
		font-family: '光良酒-干杯体';
		src: url('http://ouhechaowan.oss-cn-beijing.aliyuncs.com/ou_he_chao_wan/static/font/GuangLiangJiu-GanBeiTi.ttf') format('truetype');
	}

	@font-face {
		font-family: 'YouSheBiaoTiHei';
		src: url('http://ouhechaowan.oss-cn-beijing.aliyuncs.com/ou_he_chao_wan/static/font/YouSheBiaoTiHei.ttf') format('truetype');
	}

	page {
		overflow-x: hidden;

		&::before {
			content: '';
			display: block;
			width: 100vw;
			height: 100vh;
			position: fixed;
			left: 0;
			top: 0;
			background-size: 100% 105%;
			background-position: 0 0;
			// background-image: url('https://jidimowan.shequtuangou.vip/static/web/static/img/g_bg.png');
			background-color: #050505;
			z-index: -10;
		}

		// &::after {
		//   content: '';
		//   display: block;
		//   width: 100vw;
		//   height: 100vh;
		//   position: fixed;
		//   left: 0;
		//   top: 0;
		//   background-size: 100% 105%;
		//   background-position: 0 0;
		//   background-image: url('https://jvyang-picbed.oss-cn-beijing.aliyuncs.com/work/ou_huang_zi_you/img/global_page_bg.png');
		//   z-index: -10;
		// }
	}

	.flex_center {
		display: flex;
		align-items: center;
	}

	.hang2 {
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		word-wrap: break-word;
		word-break: break-all;
	}

	.hang1 {
		overflow: hidden;
		/*超出部分隐藏*/
		white-space: nowrap;
		/*不换行*/
		text-overflow: ellipsis;
		/*超出部分文字以...显示*/
	}

	.icon {
		display: flex;
		justify-content: center;
		align-items: center;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.common_bg,
	.c_bg {
		background-repeat: no-repeat;
		background-position: 0 0;
		background-size: 100% 100%;
	}

	.relative {
		position: relative;
	}

	button.hide {
		position: absolute;
		width: 100% !important;
		height: 100% !important;
		left: 0;
		top: 0;
		z-index: 1;
		opacity: 0;
	}

	.uni-nav-bar-l-icon {
		// padding: 0 10rpx;
		display: flex;
		align-items: center;

		.uni-nav-bar-l-icon-left {
			width: 44rpx;
			height: 44rpx;
		}
	}

	/* 重写组件样式 */
	/deep/.uni-noticebar {
		padding: 0 !important;
		margin: 0 !important;
	}

	/deep/.mescroll-upwarp {
		box-sizing: border-box;
		min-height: 55px;
		padding: 15px 0;
		text-align: center;
		clear: both;
	}

	/deep/.cmd-progress-outer {
		line-height: 0;

		.cmd-progress-bg {
			margin: 0 !important;
		}
	}
</style>